1. Field of the Invention
The present invention relates to a graphics identification program, and, more particularly, to a graphics identification program for identifying a shape of a graphic when the graphic is drawn or input via a touch panel, etc., leaving a trace of its passage.
2. Description of the Background Art
There have been various methods for identifying a shape of a graphic drawn on a touch panel, etc., by a user. Among them, a method for estimating the number of vertices of a drawn graphic and comparing the estimated number with the number of vertices of an ideal reference graphic is often used. For example, in the case where a simple graphic such as a triangle or a quadrangle is identified, this method facilitates identification of a shape of the graphic by comparing the numbers of vertices.
As means for identifying a graphic drawn on a tablet, Japanese Laid-Open Patent Publication No. H7-29002 discloses a graphics identification device (document 1). This graphics identification device identifies a graphic by performing the following processes. First, a line factor (corresponding to a side of a graphic) is extracted from an inputted sequence of coordinate points, and a length and an angle (direction) of each extracted side are calculated. Next, an angle histogram is generated based on the length and the angle of each side (see FIGS. 3C and 3D of Japanese Laid-Open Patent Publication No. H7-29002). Based on the angle histogram, the number of vertices (sides) of the graphic represented by the inputted sequence of coordinate points is estimated. In document 1, graphics identification is performed using the number of vertices estimated as described above.
Here, a case in which a graphic of complicated shape is identified will be considered. In general, the graphic of complicated shape has a large number of vertices, whereby it is difficult to accurately extract a line factor from the inputted sequence of coordinate points. As a result, it is difficult to estimate the number of vertices of the drawn graphic with accuracy. Also, in the case where a graphic of complicated shape is drawn, an input by the user often lacks the precision, which also makes it difficult to estimate the number of vertices of the drawn graphic with accuracy. As such, in the case where a graphic of complicated shape is identified, the probability that the estimated number of vertices of the drawn graphic is equal to the number of vertices of the ideal reference graphic is reduced. As a result, it is impossible to perform a precise comparison between the drawn graphic and the ideal reference graphic, thereby making it impossible to identify a shape of the drawn graphic with accuracy. That is, by the above-described method for estimating the number of vertices, it is difficult to identify a graphic of complicated shape.
Also, in document 1, the number of vertices is estimated using the angle histogram. However, this angle histogram does not consider an order in which the sides are drawn. Thus, in the case where a spiral-shaped graphic as shown in FIG. 22 is drawn, for example, portions (indicated by a dotted line in FIG. 22) which are determined to have the same side angles are regarded as one side. As a result, in document 1, it is impossible to differentiate between the shape as shown in FIG. 22 and a quadrangle, thereby making it impossible to precisely identify a graphic of complicated shape.